from django.urls import re_path

from rbac.views import menu
from rbac.views import role
from rbac.views import userinfo, permission

urlpatterns = [
    re_path(r'^role/list/$', role.role_list, name='role_list'),
    re_path(r'^role/add/$', role.role_add, name='role_add'),
    re_path(r'^role/edit/(?P<pk>\d+)/$', role.role_change, name='role_edit'),
    re_path(r'^role/delete/(?P<pk>\d+)/$', role.role_delete, name='role_delete'),

    # re_path(r'^userinfo/list/$', userinfo.userinfo_list, name='userinfo_list'),
    # re_path(r'^userinfo/add/$', userinfo.userinfo_add, name='userinfo_add'),
    # re_path(r'^userinfo/edit/(?P<pk>\d+)/$', userinfo.userinfo_edit, name='userinfo_edit'),
    # re_path(r'^userinfo/del/(?P<pk>\d+)/$', userinfo.userinfo_del, name='userinfo_del'),
    # re_path(r'^userinfo/reset/password/(?P<pk>\d+)/$', userinfo.userinfo_reset_password,
    #         name='userinfo_reset_password'),

    re_path(r'^menu/list/$', menu.menu_list, name='menu_list'),
    re_path(r'^menu/add/$', menu.menu_add, name='menu_add'),
    re_path(r'^menu/edit/(?P<pk>\d+)/$', menu.menu_edit, name='menu_edit'),
    re_path(r'^menu/del/(?P<pk>\d+)/$', menu.menu_del, name='menu_del'),

    re_path(r'^second/menu/add/(?P<menu_id>\d+)/$', menu.second_menu_add, name='second_menu_add'),
    re_path(r'^second/menu/edit/(?P<pk>\d+)/$', menu.second_menu_edit, name='second_menu_edit'),
    re_path(r'^second/menu/del/(?P<pk>\d+)/$', menu.second_menu_del, name='second_menu_del'),

    re_path(r'^permission/add/(?P<second_menu_id>\d+)/$', menu.permission_add, name='permission_add'),
    re_path(r'^permission/edit/(?P<pk>\d+)/$', menu.permission_edit, name='permission_edit'),
    re_path(r'^permission/del/(?P<pk>\d+)/$', menu.permission_del, name='permission_del'),

    re_path(r'^multi/permissions/$', menu.multi_permissions, name='multi_permission'),
    re_path(r'^multi/permissions/del/(?P<pk>\d+)/$', menu.multi_permissions_del, name='multi_permission_del'),
    re_path(r'^distribute/permissions/$', menu.distribute_permissions, name='distribute_permissions')

]
